#include "comm.hpp"
#include "log.hpp"
using namespace std;

int main(){
    // 打开管道
    int fd = open(FIFO_FILE, O_WRONLY);
    if(fd < 0){
        perror("open");
        exit(FILE_OPEN_ERR);
    }
    cout<<"client open file done! "<<endl;

    // 开始通信
    string line;
    while (true){
        cout << "Please Enter# ";
        getline(cin, line);
        write(fd, line.c_str(), line.size());
    }

    close(fd);
    return 0;
}